package com.cip.master.service.impl;

import java.util.ArrayList;
import java.util.List;

import com.cip.admin.model.User;
import com.cip.master.dao.BlogDAO;
import com.cip.master.model.Blog;
import com.cip.master.model.Comments;
import com.cip.master.service.BlogService;

public class BlogServiceImpl implements BlogService {
	private BlogDAO blogDAO;
	
	public List<Blog> getMyBlogsById(int id) throws Exception{
		return blogDAO.getMyBlogsById(id);
	}
	
	public List<Blog> getOthersBlogList(int id) throws Exception{
		return blogDAO.getOthersBlogList(id);
	}

	public Blog saveOrUpdateBlog(Blog blog) throws Exception{
		return blogDAO.saveOrUpdateBlog(blog);
	}
	
	public Blog getBlogDetails(int id) throws Exception{
		return blogDAO.getBlogDetails(id);
	}
	
	public List<Comments> getCommentsByBlogId(int blogId) throws Exception{
		return blogDAO.getCommentsByBlogId(blogId);
	}
	
	public Comments saveOrUpdateComment(Comments comments) throws Exception{
		return blogDAO.saveOrUpdateComment(comments);
	}
	
	public BlogDAO getBlogDAO() {
		return blogDAO;
	}

	public void setBlogDAO(BlogDAO blogDAO) {
		this.blogDAO = blogDAO;
	}
	
}
